/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.rationalsheet.parser;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Overmind
 */
public class Main
{

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args)
    {
        Parser parser = new Parser();
	
	BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
	BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));
	
        System.out.println(1-1-1);
	String data;
	
	try
	{
	    do
	    {
		writer.write("Write formulas: \n");
		writer.flush();
		data = reader.readLine();
		writer.write(data + " = " + parser.parse(data) + "\n");
	    }while(!data.equals("exit"));
	}
	catch(IOException ex)
	{
	    Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null,
		ex);
	}
    }
}
